#include "StdAfx.h"
#include <sstream>
#include "CompilerOutputTabView.h"

using namespace std;

void CCompilerOutputTabView::MarkLineContainigStringInColor(std::wstring textCriteria, COLORREF color)
{
	const wstring &currentText = GetRichEdit()->GetText();

	basic_stringstream<wchar_t> text((wchar_t *)currentText.c_str());

	wstring textLine;
	int line = 1;

	while (getline(text, textLine))
	{
		if (textLine.find(textCriteria) != wstring::npos)
			GetRichEdit()->SetLineColor(line, color);
		++line;
	}
}